<template>
  <div class="app-container">
    <el-card>
      <el-row :gutter="24" class="fz-14 tc">
        <el-col :span="4">
          <div class="color6">咨询订单</div>
          <div class="pt-10">{{form.orderNo || ""}}</div>
        </el-col>
        <el-col :span="4">
          <div class="color6">咨询类型</div>
          <div class="pt-10">
            <dict-tag :options="dict.type.calltype" :value="form.callType"/>
          </div>
        </el-col>
        <el-col :span="4">
          <div class="color6">咨询方式</div>
          <div class="pt-10">
            <dict-tag :options="dict.type.call_method" :value="form.callMethod"/>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="color6">开始时间</div>
          <div class="pt-10">{{parseTime(form.callTimestart)}}</div>
        </el-col>
        <el-col :span="6">
          <div class="color6">结束时间</div>
          <div class="pt-10">{{parseTime(form.callTimeend)}}</div>
        </el-col>
      </el-row>
    </el-card>

    <el-table v-loading="loading" :data="detailsList" class="mt-20">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="房间号" align="center" width="120">
        <template>
          <div>{{form.meetingRoomNumber}}</div>
        </template>
      </el-table-column>
      <el-table-column label="参会人" align="center" prop="joinUserName" />
      <el-table-column label="入会终端" align="center" prop="terminalType" width="100">
        <template slot-scope="{row}">
          <dict-tag :options="dict.type.terminal_type" :value="String(row.terminalType)"/>
        </template>
      </el-table-column>
      <el-table-column label="终端型号" align="center" prop="terminalModel" />
      <el-table-column label="参会人角色" align="center" prop="joinRole" width="100">
        <template slot-scope="{row}">
          <span>{{ row.joinRole === 2 ? '专家' : '用户' }}</span>
          <!-- <dict-tag :options="dict.type.expstart" :value="String(row.joinRole)"/> -->
        </template>
      </el-table-column>
      <el-table-column label="入会方式" align="center" prop="joinMethod">
        <template slot-scope="{row}">
          <dict-tag :options="dict.type.join_method" :value="String(row.joinMethod)"/>
        </template>
      </el-table-column>
      <el-table-column label="所属单位" align="center" prop="expName" min-width="250" />
      <el-table-column label="进入时间" align="center" prop="entryTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.entryTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="离开时间" align="center" prop="departureTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.departureTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="参会时长" align="center" prop="duration">
        <template slot-scope="{row}">
          <span>{{row.duration}}分钟</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="附件" align="center" prop="" />  -->
    </el-table>
  </div>
</template>

<script>
import { getDetails } from "@/api/order/consultdetails";
export default {
  name: "Consultdetails",
  dicts: ['calltype','call_method','terminal_type','join_method', 'expstart'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 总条数
      total: 0,
      // 表单参数
      form: {},
      // 咨询详情表格数据
      detailsList: [],
    };
  },
  created() {
    const orderNo = this.$route.params && this.$route.params.orderId;
    this.getList(orderNo);
  },
  methods: {
    /** 查询咨询详情列表 */
    getList(orderNo) {
      this.loading = true;
      getDetails(orderNo).then(response => {
        this.form = response.data.videoOrder
        this.detailsList = response.data.recordList
        this.loading = false;
      });
    },
    // // 多选框选中数据
    // handleSelectionChange(selection) {
    //   this.ids = selection.map(item => item.id)
    //   this.single = selection.length!==1
    //   this.multiple = !selection.length
    // },
  }
};
</script>
